<?php

global $_GPC;
$text=$_GPC['text'];
$type=$_GPC['type'];
$id=$_GPC['id'];


require_once dirname(__FILE__)."/../model/user.php";
require_once dirname(__FILE__)."/../model/api.php";
/*if(!isUser()){
    $url =$this->createMobileUrl('login');
    header("location: $url");
    setJumpUrl();
    die();
}
$user= getUser();*/





if($type==1){
    /*支部风采评论*/

    $request = postCurl(getServer()."/doPartymessageInfo",array(
        "memberid"=>$user['id'],
        "membername"=>$user["name"],
        "message"=>$text,
        "partyid"=>$id
    ));


}else{
    /*党员风采评论*/

    $request = postCurl(getServer()."/doMembermessageInfo",array(
        "memberid"=>$user['id'],
        "membername"=>$user["name"],
        "message"=>$text,
        "memberstyleid"=>$id
    ));

}

if ($request["ret"]==0){
    echo json_encode(array('status'=>true,'result'=>'评论成功'),true);
}else{
    echo json_encode(array('status'=>false,'result'=>'评论失败，请重试！'),true);
}